package routes

import (
	"server/app/controllers/app"
	"server/app/middleware"
	"server/app/services"

	"github.com/gin-gonic/gin"
)

func SetVideoGroupRoutes(router *gin.RouterGroup) {
	router.GET("/list", app.VideoList)
	router.GET("/:videoId/detail", app.VideoDetail)
	authRouter := router.Group("").Use(middleware.JWTAuth(services.AppGuardName))
	{
		authRouter.POST("/like", app.VideoLike)
		authRouter.POST("/:videoId/comment", app.VideoComment) //REST api
		authRouter.GET("/:videoId/comment/list", app.VideoCommentList)
		authRouter.DELETE("/:videoId/delete", app.DeleteVideo)
		authRouter.PATCH("/:videoId/update", app.UpdateVideo)
	}
}
